﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;

namespace ConsoleApplication3.AbstraX
{
    public class EntitiesRoot : Base, IRoot
    {
        string url = @"..\..\Model1.edmx";

        public EntitiesRoot()
        {
            var edmxDoc = new XmlDocument();

            edmxDoc.Load(url);

            var nsMgr = new XmlNamespaceManager(edmxDoc.NameTable);

            nsMgr.AddNamespace("edmx", "http://schemas.microsoft.com/ado/2007/06/edmx");
            nsMgr.AddNamespace("s", "http://schemas.microsoft.com/ado/2007/06/edm/ssdl");
            nsMgr.AddNamespace("e", "http://schemas.microsoft.com/ado/2006/04/edm");
            nsMgr.AddNamespace("u", "urn:schemas-microsoft-com:windows:storage:mapping:SC");

            var entityTypes = edmxDoc.DocumentElement.SelectNodes("//e:EntityType", nsMgr);
        }

        public string URL
        {
            get 
            {
                return url;
            }
        }

        public List<IElement> RootElements
        {
            get 
            {
                var rootElements = new List<IElement>();

                return rootElements;
            }
        }
    }
}
